package com.ph.product.api.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alibaba.dubbo.config.annotation.Reference;
import com.ph.shopping.common.util.result.Result;
import com.ph.shopping.facade.product.service.IPhProductImageService;
import com.ph.shopping.facade.product.vo.PhProductImageVo;

/**
 * @项目：phshopping-api-platform
 * @描述：商品图片查询 @作者： hewl
 * @创建时间：2017年3月6日 上午11:15
 * @Copyright by hewl
 * @version 1.0.0
 */
@Controller
@RequestMapping("/api/phProduct/image")
public class ProductImageController {
	// 引用商品图片service
	@Reference(version = "1.0.0")
	private IPhProductImageService iPhProductImageService;

	/**
	 * 查询商品图片列表
	 * 
	 * @author hewl
	 * @param phProductImageVo
	 * @return Result
	 */
	@RequestMapping(value = "/getPhProductImageList", method = RequestMethod.GET)
	public @ResponseBody Result getPhProductImageList(PhProductImageVo phProductImageVo) throws Exception {
		Result result = new Result();
		result.setData(iPhProductImageService.getPhProductImageList(phProductImageVo));
		return result;
	}

	/**
	 * 单条查询商品图片
	 * 
	 * @author hewl
	 * @param phProductImageVo
	 * @return Result
	 */
	@RequestMapping(value = "/getPhProductImage", method = RequestMethod.GET)
	public @ResponseBody Result getPhProductImage(PhProductImageVo phProductImageVo) throws Exception {
		Result result = new Result();
		result.setData(iPhProductImageService.getPhProductImage(phProductImageVo));
		return result;
	}

}
